Attribute VB_Name = "Module1"
Option Explicit

'Dim bi As BROWSEINFO
'Dim IDL As ITEMIDLIST
'Dim pidl As Long
'Dim r As Long
'Dim pos As Integer
'Dim spath As String
'
'bi.hOwner = Me.hWnd
'bi.pidlRoot = 0&
'bi.lpszTitle = "Select a location to install the iNet Web Browser"
'bi.ulFlags = BIF_RETURNONLYFSDIRS
'pidl& = SHBrowseForFolder(bi)
'spath$ = Space$(512)
'r = SHGetPathFromIDList(ByVal pidl&, ByVal spath$)
'
'If r Then
'    pos = InStr(spath$, Chr$(0))
'    'installpath.Text = Left(spath$, pos - 1)
'End If

Public Type SHITEMID 'mkid
    cb As Long
    abID As Byte
End Type

Public Type ITEMIDLIST 'idl
    mkid As SHITEMID
End Type

Public Type BROWSEINFO 'bi
    hOwner As Long
    pidlRoot As Long
    pszDisplayName As String
    lpszTitle As String
    ulFlags As Long
    lpfn As Long
    lParam As Long
    iImage As Long
End Type

Public Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Const BIF_RETURNONLYFSDIRS = &H1

